﻿using DevExpress.Xpf.Charts;
using System.Collections.Generic;
using System.Windows.Data;

namespace TeBigCommonUI.Items
{
    public abstract partial class AreaChart : XYDiagramChartControl
    {
        public AreaChart()
        {
            InitializeComponent();
        }


        protected override void OnInitChart()
        {
            InitChartInternal(chart, chart_diagram);
        }
    }

    public class Area2DChart : AreaChart
    {
        protected override Series CreateSeriesFromDataSource(IList<SeriesDataSource> source, int index)
        {
            return new SplineAreaSeries2D();
        }
    }

    public class AreaWithLineChart : AreaChart
    {
        protected override Series CreateSeriesFromDataSource(IList<SeriesDataSource> source, int index)
        {
            if (index < this.SeriesDataSources.Count - 1)
            {
                return new SplineAreaSeries2D();

            }
            else
            {
                return new LineSeries2D()
                {
                    MarkerModel = new CircleMarker2DModel(),
                    MarkerVisible = true,
                };

            }
        }
    }
}